/*
 * The RavenX Library
 * Copyright (c) 2008 by Solidus
 * 
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.It is provided "as is" without express 
 * or implied warranty.
 *
 */
#ifndef RX_VECTOR_H
#define RX_VECTOR_H

#include "rx_typedef.h"

RX_SPACE_BEG

typedef struct __rx_vector_tag rx_vector_t;



RavenAPI rx_vector_t* rx_vector_create(const rx_info_t *info, const rx_alloc_t *palloc);

RavenAPI const rx_info_t* rx_vector_info(const rx_vector_t *self);
RavenAPI const rx_alloc_t* rx_vector_allocator(const rx_vector_t *self);

RavenAPI rx_vector_t* rx_vector_copy(const rx_vector_t *self);

RavenAPI void rx_vector_clear(rx_vector_t *self);

RavenAPI void rx_vector_destroy(rx_vector_t *self);

RavenAPI void* rx_vector_insert(rx_vector_t *self, void *pos, const void *value);

RavenAPI void* rx_vector_insert_pos(rx_vector_t *self, size_t pos, const void *value);

RavenAPI void* rx_vector_insert_range(rx_vector_t *self,  void *pos,  const rx_vector_t *other, const void *first,  const void *last);

RavenAPI void* rx_vector_erase_range(rx_vector_t *self, void *first, void *last);

RavenAPI void* rx_vector_erase_index(rx_vector_t *self, size_t beg, size_t count);

RavenAPI void* rx_vector_erase(rx_vector_t *self, void *pos);

RavenAPI void rx_vector_pop_back(rx_vector_t *self);

RavenAPI void rx_vector_push_back(rx_vector_t *self, const void *value);

RavenAPI void rx_vector_push_back_range(rx_vector_t *self, const rx_vector_t *other, const void *first, const void *last);

RavenAPI void rx_vector_push_front(rx_vector_t *self, const void *value);

RavenAPI void rx_vector_pop_front(rx_vector_t *self);

RavenAPI void rx_vector_pop_back(rx_vector_t *self);

RavenAPI void* rx_vector_back(rx_vector_t *self);

RavenAPI void* rx_vector_front(rx_vector_t *self);

RavenAPI void* rx_vector_next(rx_vector_t *self, void *curr);

RavenAPI void* rx_vector_end(rx_vector_t *self);

RavenAPI void* rx_vector_begin(rx_vector_t *self);

RavenAPI void* rx_vector_at(rx_vector_t *self, size_t idx);

RavenAPI rx_bool rx_vector_is_empty(const rx_vector_t *self);

RavenAPI size_t rx_vector_capacity(const rx_vector_t *self);

RavenAPI size_t rx_vector_size(const rx_vector_t *self);

RavenAPI void rx_vector_resize(rx_vector_t *self, size_t size);

RavenAPI void rx_vector_reserve(rx_vector_t *self, size_t size);

RavenAPI rx_int_n rx_vector_indexof(rx_vector_t *self, const void *key);

RavenAPI void rx_vector_sort(rx_vector_t *self);

RavenAPI rx_bool rx_vector_add_distinct(rx_vector_t *self, const void *key);

RavenAPI void	rx_vector_swap(rx_vector_t *l, rx_vector_t *r);

#define rx_vector_erase_pos(self, pos) (rx_vector_erase(self, rx_vector_at(self, pos)))






RX_SPACE_END




#endif

